package com.bella.springcloud.controller;/**
 * @program: cloud2022
 * @description:
 * @packagename: com.bella.springcloud.controller
 * @author: Bella白
 * @date: 2022-09-02 15:54
 **/

import com.bella.springcloud.entities.CommonResult;
import com.bella.springcloud.entities.Payment;
import com.bella.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: bella白
 * @Title: OrderFeignController
 * @ProjectName: cloud2022
 * @Description:
 * @date: 2022/9/2 15:54
 */
@RestController
@Slf4j
public class OrderFeignController {
    @Resource
    private PaymentFeignService paymentFeignService;
    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id")Long id){
        return paymentFeignService.getPaymentById(id);
    }
    @GetMapping("/consumer/payment/feign/timeout")
    public String paymentFeignTimeout(){
//        openfeign-ribbon 客户端一般默认一秒
        return paymentFeignService.paymentFeignTimeout();
    }
}
